<?php
class Demo {
    /**
     *默认调用的方法index
    */
    public function index(){
        echo "index in demo";
    }
    
    public function sayHello($name="default name"){
        context("name",$name);
        context("title","Hello Title");
        delay("getMsg", function($xx="default XX") use($name){
            return "gogo {$name} ".$xx;
        });
        View::load();
    }
    
    public function img(){
        $img=  GDImage::fromFile(STATIC_PATH."images/girl.jpg");
        Header::ContentType("image/png");
        $img->png();
    }
}
